package com.zhou.project.modules.circle.circlePostsComment.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zhou.project.components.base.entity.Base;
import com.zhou.project.modules.circle.circleGroupPosts.entity.CircleGroupPosts;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Getter
@Setter
@TableName(value = "ucc_circle_posts_comment",resultMap = "CommentResultMap")
@ApiModel("[圈子模块-话题评论管理-数据模型]")
public class CirclePostsComment extends Base {

    @ApiModelProperty(name = "userId",value = "用户id",required = true,dataType = "int")
    @NotNull(message = "用户的id不允许为空")
    private Integer userId;

    @ApiModelProperty(name = "postsId",value = "话题id",required = true,dataType = "int")
    @NotNull(message = "话题的名称不允许为空")
    private Integer postsId;

    @ApiModelProperty(name = "postsText",value = "评论内容",required = true,dataType = "String")
    @NotBlank(message = "评论内容不允许为空")
    @Length(min = 4,max = 200,message = "评论的长度因为{min}-{max}")
    private String postsText;

    @ApiModelProperty(name = "pid",value = "想评论的id",required = false,dataType = "int")
    private Integer pid;

    @TableField(exist = false)
    private CircleGroupPosts circleGroupPosts;
}
